package com.starrin.trashtalk;

import com.starrin.trashtalk.dao.MatchDAO;
import com.starrin.trashtalk.dao.MatchDAOImpl;
import com.starrin.trashtalk.model.SingleMatch;

import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import java.io.Serializable;
import java.util.List;

/**
 * Created by larsstarrin on 19/10/14.
 */
@ManagedBean
@ViewScoped
public class ResultsBean implements Serializable{

    private MatchDAO matchDAO = new MatchDAOImpl();
    private List<SingleMatch> matches;

    @PostConstruct
    public void init() {
        matches = matchDAO.findAllMatches();
    }

    public List<SingleMatch> getMatches() {
        return matches;
    }

    public void setMatches(List<SingleMatch> matches) {
        this.matches = matches;
    }
}
